import json

def favourite_number():
    '''显示用户最喜欢的数'''
    file_name='favourite name.json'
    try:
        with open(file_name) as f:
            f_number=json.load(f)
    except FileNotFoundError:
        f_number=input("Please input favourite number")
        with open(file_name,'w') as f:
            json.dump(f_number,f)
    else:
        print(f"Your favourite number is {f_number} !")

favourite_number()